Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ignore loaders and absolute paths #36

Merged
merged 1 commit into from
May 1, 2020
Merged

Ignore loaders and absolute paths #36

merged 1 commit into from
May 1, 2020

Conversation

amasad
Copy link
Member

@amasad amasad commented Apr 30, 2020

Webpack allows users to add ! to load arbitrary files and this should be ignored by upm.
More generally I ported the code from here

if (module.indexOf("!") != -1) {
continue;
}
// Prevent our code from crashing.
if (module === "") {
continue;
}
// Skip local modules.
if (module[0] === ".") {
continue;
}
// Skip absolute modules.
if (module[0] === "/") {
continue;
}

Copy link
Contributor

@dan-stowell dan-stowell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If it's good enough for bare-imports.js, it's good enough for its successor!

@amasad amasad merged commit d2c48ca into master May 1, 2020
@amasad
Copy link
Member Author

amasad commented May 1, 2020

Thanks!

@amasad amasad deleted the am-fix-script branch May 1, 2020 01:09
@blast-hardcheese blast-hardcheese added the enhancement New feature or request label Dec 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants